
*Set working directory
cd "~/Dropbox/demselect/bkp_ejir_rep"

use demselect, clear

*Convergence is actually fastest in version 10
version 10 

****Primary Models
*Model 1 (Polity)
logit initiate relcap_targ demchal6 relcap_targ_demchal6 cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid) 

*Model 2 (CGV)
logit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid)
*Model 3 (GWF)
logit initiate relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow ///
	cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)
*Model 4 (Weeks)
logit initiate relcap_targ weeks_dem relcap_targ_weeks_dem weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong cap_1 ///
	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid)


****Appendix Models

**Table A1 / Fig A2
logit initiate relcap_targ demchal6 relcap_targ_demchal6 cap_1 cap_2  ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, ///
	nolog robust cluster(dyadid) 
logit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid) 
logit initiate relcap_targ gwf_dem relcap_targ_gwf_dem cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid) 
logit initiate relcap_targ weeks_dem relcap_targ_weeks_dem cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid) 



**Table A2 / Fig A3-A4
logit initiate_revisionist relcap_targ demchal6 relcap_targ_demchal6 cap_1 ///
 	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
 	, nolog robust cluster(dyadid) 
logit initiate_revisionist relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	 relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 s_wt_glo ///
	 contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	 , nolog robust cluster(dyadid)
logit initiate_revisionist relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)
logit initiate_revisionist relcap_targ weeks_dem relcap_targ_weeks_dem ///
	 weeks_mach relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss ///
	 weeks_junta relcap_targ_weeks_junta weeks_strong ///
	 relcap_targ_weeks_strong cap_1 cap_2 s_wt_glo contigdum dependlow ///
	 cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)


**Figure A5
logit initiate_highmid relcap_targ demchal6 relcap_targ_demchal6 cap_1 ///
	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid) 
logit initiate_highmid relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid)
logit initiate_highmid relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)
logit initiate_highmid relcap_targ weeks_dem relcap_targ_weeks_dem ///
	weeks_mach relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss ///
	 weeks_junta relcap_targ_weeks_junta weeks_strong ///
	 relcap_targ_weeks_strong cap_1 cap_2 s_wt_glo contigdum dependlow ///
	 cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)

**Figure A6
logit initiate_highmid_revisionist relcap_targ demchal6 ///
	relcap_targ_demchal6 cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid) 
logit initiate_highmid_revisionist relcap_targ cgv_dem relcap_targ_cgv_dem ///
	cgv_mil relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid) 
logit initiate_highmid_revisionist relcap_targ gwf_dem relcap_targ_gwf_dem ///
	gwf_mil relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid) 
logit initiate_highmid_revisionist relcap_targ gwf_dem relcap_targ_gwf_dem ///
	gwf_mil relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid) 



**Figure A8
logit initiate relcap_targ demchal6 relcap_targ_demchal6 cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 if year<1990 ///
	, nolog robust cluster(dyadid) 
logit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 if year<1990, nolog ///
	robust cluster(dyadid) 
logit initiate relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3 if year<1990, nolog robust cluster(dyadid) 
logit initiate relcap_targ weeks_dem relcap_targ_weeks_dem weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong cap_1 ///
	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 if ///
	year<1990, nolog robust cluster(dyadid) 

**Figure A9
relogit initiate relcap_targ demchal6 relcap_targ_demchal6 cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, cluster(dyadid) 
relogit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, cluster(dyadid)
relogit initiate relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 s_wt_glo contigdum dependlow cwpceyrs ///
	cwpceyrs2 cwpceyrs3, cluster(dyadid) 
relogit initiate relcap_targ weeks_dem relcap_targ_weeks_dem weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong cap_1 ///
	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, cluster(dyadid)


**Figure A10
logit initiate relcap_targ demchal6 relcap_targ_demchal6 cwpceyrs cwpceyrs2 ///
	cwpceyrs3, nolog robust cluster(dyadid) 
logit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cwpceyrs cwpceyrs2 ///
	cwpceyrs3, nolog robust cluster(dyadid)
logit initiate relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust ///
	cluster(dyadid)
logit initiate relcap_targ weeks_dem relcap_targ_weeks_dem weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong cwpceyrs ///
	cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)

**Figure A11
logit initiate relcap_targ demchal6 relcap_targ_demchal6 s_wt_glo contigdum ///
	dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid) 
logit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ s_wt_glo contigdum ///
	dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)
logit initiate relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 ///
	cwpceyrs3, nolog robust cluster(dyadid)
logit initiate relcap_targ weeks_dem relcap_targ_weeks_dem weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust ///
	cluster(dyadid)


*Table A3 / Fig A12
heckprob war relcap_targ demchal6 relcap_targ_demchal6 s_wt_glo contigdum ///
	, sel(initiate = relcap_targ demchal6 relcap_targ_demchal6 cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3) robust ///
	cluster(dyadid)
*Table A4 / Fig A12
heckprob war relcap_targ cgv_dem relcap_targ_cgv_dem s_wt_glo contigdum ///
	, sel(initiate = relcap_targ cgv_dem relcap_targ_cgv_dem cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3) robust ///
	cluster(dyadid)
heckprob war relcap_targ gwf_dem relcap_targ_gwf_dem s_wt_glo contigdum ///
	, sel(initiate = relcap_targ gwf_dem relcap_targ_gwf_dem cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3) robust ///
	cluster(dyadid)
heckprob war relcap_targ weeks_dem relcap_targ_weeks_dem s_wt_glo contigdum ///
	, sel(initiate = relcap_targ weeks_dem relcap_targ_weeks_dem cap_1 cap_2 ///
	s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3) ///
	robust cluster(dyadid)

*Table A5
probit war relcap_targ demchal6 relcap_targ_demchal6 s_wt_glo contigdum ///
	,  robust cluster(dyadid)
probit war relcap_targ cgv_dem relcap_targ_cgv_dem s_wt_glo contigdum ///
	,  robust cluster(dyadid)
probit war relcap_targ gwf_dem relcap_targ_gwf_dem s_wt_glo contigdum ///
	, robust cluster(dyadid)
probit war relcap_targ weeks_dem relcap_targ_weeks_dem s_wt_glo contigdum ///
	, robust cluster(dyadid)


*Table A6/Fig A13-A14
logit initiate relcap_targ demchal6 relcap_targ_demchal6 cap_1 cap_2 ///
	distance cap1_distance cap2_distance relcap_targ_distance s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust ///
	cluster(dyadid) 
logit initiate relcap_targ cgv_dem relcap_targ_cgv_dem cgv_mil ///
	relcap_targ_cgv_mil cgv_civ relcap_targ_cgv_civ cap_1 cap_2 distance ///
	cap1_distance cap2_distance relcap_targ_distance s_wt_glo contigdum ///
	dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)
logit initiate relcap_targ gwf_dem relcap_targ_gwf_dem gwf_mil ///
	relcap_targ_gwf_mil gwf_party relcap_targ_gwf_par gwf_personal ///
	relcap_targ_gwf_per cap_1 cap_2 distance cap1_distance cap2_distance ///
	relcap_targ_distance s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 ///
	cwpceyrs3, nolog robust cluster(dyadid)
logit initiate relcap_targ weeks_dem relcap_targ_weeks_dem weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong cap_1 ///
	cap_2 distance cap1_distance cap2_distance relcap_targ_distance s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust ///
	cluster(dyadid)

*Table A7/Fig A15
logit initiate relcap_targ demchal6_wes relcap_targ_demchal6_wes ///
	demchal6_nonwes relcap_targ_demchal6_nonwes cap_1 cap_2 s_wt_glo ///
	contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust ///
	cluster(dyadid) 
logit initiate relcap_targ cgv_dem_wes relcap_targ_cgv_dem_wes ///
	cgv_dem_nonwes relcap_targ_cgv_dem_nonwes cgv_mil relcap_targ_cgv_mil ///
	cgv_civ relcap_targ_cgv_civ cap_1 cap_2 s_wt_glo contigdum dependlow ///
	cwpceyrs cwpceyrs2 cwpceyrs3, nolog robust cluster(dyadid)
logit initiate relcap_targ gwf_dem_wes relcap_targ_gwf_dem_wes ///
	gwf_dem_nonwes relcap_targ_gwf_dem_nonwes gwf_mil relcap_targ_gwf_mil ///
	gwf_party relcap_targ_gwf_par gwf_personal relcap_targ_gwf_per cap_1 ///
	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3, ///
	nolog robust cluster(dyadid)
logit initiate relcap_targ weeks_dem_wes relcap_targ_weeks_dem_wes ///
	weeks_dem_nonwes relcap_targ_weeks_dem_nonwes weeks_mach ///
	relcap_targ_weeks_mach weeks_boss relcap_targ_weeks_boss weeks_junta ///
	relcap_targ_weeks_junta weeks_strong relcap_targ_weeks_strong cap_1 ///
	cap_2 s_wt_glo contigdum dependlow cwpceyrs cwpceyrs2 cwpceyrs3 ///
	, nolog robust cluster(dyadid)






